package hpu.bitenergy.List;

import hpu.bitenergy.util.MongoDBHerlper;
import hpu.bitenergy.util.StringHelper;

import java.util.List;

import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;

/**
 * 专家list
 * 
 * @author Administrator
 *
 */

public class ExpertsList extends GetList {

	@Override
	public List<DBObject> getQueryList(BasicDBObject query) {

		MongoDBHerlper mo = new MongoDBHerlper();
		DBCollection col = mo.GetDB(StringHelper.DBNAME,
				StringHelper.EXPERTSCOL);
		List<DBObject> li=col.find(query).toArray();
		return li;
	}
	
	//d得到推荐专家
	@Override
	public List<DBObject> getQueryListLimit(BasicDBObject query) {

		MongoDBHerlper mo = new MongoDBHerlper();
		DBCollection col = mo.GetDB(StringHelper.DBNAME,
				StringHelper.EXPERTSCOL);
		List<DBObject> li=col.find().limit(6).sort(query).toArray();
		return li;
	}
	
}
